<template>
  <BaseBreadcrumb />
  <!--表格-->
  <BaseTable
    ref="baseTable"
    :columns="columns"
    :has-selected="false"
    :api="USER_API_PRE_SUFFER"
    :params="search"
    :is-custom-update="true"
    @operationChange="drawer.handlerOperation"
  />
  <BaseDrawer v-model:visible="props.visible" v-bind="props">
    <Update v-bind="props" @refresh="drawer.refresh" @close="drawer.close" />
  </BaseDrawer>
</template>

<script lang="ts" setup>
import { defineAsyncComponent, onMounted } from 'vue'
import { columns } from './columns'
import { search } from './search'
import { USER_API_PRE_SUFFER } from '../../../api/system/user'
import { useDrawer } from '@/hooks/base/DrawerHooks'
import { deptSelected } from '@/api/system/dept'
import { injectCustomUpdateOptions } from '@/utils/form-item-util'
import { BaseParam, BaseType } from '@/components/base/form-item/props'
const Update = defineAsyncComponent(() => import('./Update.vue'))
const drawer = useDrawer(USER_API_PRE_SUFFER, '用户信息')
const props = drawer.props
onMounted(() => {
  injectCustomUpdateOptions(search.value, 'deptId', deptSelected)
})
</script>

<style scoped lang="scss"></style>
